<template>
	<view class="content">
		<scroll-view style="height: calc(100vh);" class="wid100" scroll-y="true" @scrolltolower="lower">
			<view style="height: 1rpx;"></view>
			<block v-for="(item,index) in list" :key="index">
				<view class="wid90 mar mar-top40 borRad20 bacFFF" style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0,0,0,0.1);padding: 30rpx 0;">
					<view class="wid90 mar dis disAl">
						<view class="wid25">
							<image :src="item.coverimg" style="width: 130rpx;height: 130rpx;" class="borRad50">
							</image>
						</view>
						<view class="dis disAl disJuB" style="width: 75%;">
							<view>
								<view class="foSi40 fowe600">{{item.name}}</view>
								<view class="mar-top30 foSi20">
									<span>
										<span>已接单</span>
										<span class="mar-left10" :style="'color: '+theme.main_color+';'">{{item.order_num}}</span>
									</span>
									<span class="mar-left30">
										<span>粉丝数</span>
										<span class="mar-left10" :style="'color: '+theme.main_color+';'">{{item.fans}}</span>
									</span>
								</view>
							</view>
							<view class="dis disAl">
								<uni-icons type="location-filled" size="30rpx" :color="theme.main_color"></uni-icons>
								<view class="foSi25 mar-left10">{{item.km}}</view>
							</view>
						</view>
					</view>
				</view>
			</block>
			<view style="height: 50rpx;"></view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				url: this.global.url,
				xuan: 0,
				last_page: 0,
				page: 1,
				list: [],
				theme: null
			}
		},
		onLoad() {
			this.getList()
			this.theme = uni.getStorageSync('theme')
		},
		methods: {
			getList(){
				var that = this
				uni.showLoading({
					title:'加载中...'
				})
				uni.request({
					url: that.global.url+'api/qianyu_smfw/user/follow_list',
					method: 'POST',
					header:{
						'site-id':that.global.site_id,
						'token': uni.getStorageSync('token')
					},
					data: {
						lon: uni.getStorageSync('lon')?uni.getStorageSync('lon'):125.35043,
						lat: uni.getStorageSync('lat')?uni.getStorageSync('lat'):43.86414,
					},
					success(res) {
					    let result = res.data
					    if(result.code == 1){
							that.list = result.data
						}else{
					        uni.showToast({
					            title: result.msg,
					            icon:'none',
								duration: 2000
					        })
					    }
					},
					complete() {
						uni.hideLoading()
					}
				})
			},
			xuanClick(index) {
				if (this.xuan != index) {
					this.xuan = index
				}
			},
			lower(e) {
				if (this.last_page > this.page) {
					this.page++
					this.getList()
				}
			},
			tiaozhuan(url) {
				uni.navigateTo({
					url: url
				})
			}
		}
	}
</script>

<style>
	.content {
		min-height: 100vh;
		background-color: #F2F2F2;
	}

	.tim1 {
		padding: 15rpx;
		background-color: #00C82D;
		border-radius: 5rpx;
	}

	.butt2 {
		width: 105rpx;
		height: 40rpx;
		background-color: #00C82D;
		border-radius: 5rpx;
	}
</style>